# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=py3-pyclipper
_pyname=pyclipper
pkgver=1.2.1
pkgrel=1
pkgdesc="Cython wrapper for clipper"
url="https://github.com/fonttools/pyclipper"
arch="all"
license="MIT"
depends="python3"
makedepends="py3-setuptools py3-setuptools_scm python3-dev cython clipper-dev"
checkdepends="py3-pytest py3-pytest-runner"
source="https://files.pythonhosted.org/packages/source/p/$_pyname/$_pyname-$pkgver.zip
	10-system-libs.patch
	disable-broken-test.patch
	use-unittest-instead-of-unittest2.patch
"
builddir="$srcdir/$_pyname-$pkgver"

prepare() {
	default_prepare
	# For system-wide consistency, and to save installation space,
	# we use the shared library from Alpine package "clipper".
	rm pyclipper/clipper.cpp pyclipper/clipper.hpp
}

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="f494c5ea8423fa3749b358c888be49fbb618b2b4962156dbbd1f17e7b03fd171931133d9312145d5231d6472e457d08043d5792386f03ae73901798b748f7683  pyclipper-1.2.1.zip
855d20489b4f7d90242ac2cb81b00b555d11925bf7c87d523a03ca3807fb1902d67a71645f7bc37f1997fd8bf779af06cb164f6de3a221149df7b69d4c2a283b  10-system-libs.patch
06ced9f3410f436986109a7f0d54ccdd69597e75fb44c26d9dd1909b59a1a987f07ad55d2a0e24d114f2af31b3aa51cd6f44d7fe1658a625ac53e33bef379d8a  disable-broken-test.patch
8573fbd7b56a61ac3836449ce7298963d46d081d402590e4ac781cebb3f4b1d92ef6ffd089d0a5d1cfaf6cb0ebf0230faa13a1fa0ace0f55e8c7907f94787dbf  use-unittest-instead-of-unittest2.patch"
